<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2025/5/4
  Time: 16:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import="com.project.DB_Order" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<!DOCTYPE html>
<html>
<head>
    <title>删除订单</title>
</head>
<body>
<h2>删除订单</h2>
<%
    String oid = request.getParameter("oid");
    if (oid != null) {
        List<String> deleteInput = new ArrayList<>();
        deleteInput.add(oid);

        DB_Order dbOrder = new DB_Order();
        boolean deleteResult = dbOrder.delete(deleteInput);

        if (deleteResult) {
            response.sendRedirect("index.jsp");
        } else {
            out.println("删除订单失败");
        }
    } else {
        out.println("未获取到订单ID");
    }
%>
</body>
</html>